package org.oneblog.data.service;

import java.util.List;

import org.oneblog.data.bean.ArticleSolr;
import org.oneblog.data.bean.CategoryFacet;
import org.oneblog.data.bean.HotTag;
import org.oneblog.data.query.ArticleSolrQuery;
import org.oneblog.data.rs.Result;

public interface IArticleSolrService {

    //插入
    int insertArticles(ArticleSolr article);
    
    //更新
    int updateArticles(ArticleSolr article);
    
    //更新浏览数
    int updateArticleBroswerCount(String articleId, int count);
    
    //获取详情
    ArticleSolr getById(String articleId);
    
    //查询
    Result<ArticleSolr> queryArticles(ArticleSolrQuery query);
    
    //统计热门标签
    List<HotTag> getHotTags();
    
    //浏览量排名前n位
    List<ArticleSolr> queryHotArticles(int limit);

    //推荐排名前多少位
    List<ArticleSolr> queryPriority(int limit);
    
    CategoryFacet categoryFacet();

    List<ArticleSolr> queryRelativeArticles(String id, String title, List<String> tags);
    
    List<String> getAllArticleIds();
    
    List<ArticleSolr> getArticlesForIds(List<String> ids);

    int increaseGoodCount(String articleId);
    
    boolean rebuildAll();
}
